<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Optimist Racing: C:/Users/Owner/My Programming/Personal Projects/VideoGames/Optimist Racing/src/Main.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Optimist Racing
   &#160;<span id="projectnumber">0.1</span>
   </div>
   <div id="projectbrief">A video game where you must literally keep your head up</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_main_8cpp.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">Main.cpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;GL\glew.h&gt;</code><br/>
<code>#include &lt;GL\freeglut.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="_lagrange_8hpp_source.html">Lagrange.hpp</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_bezier_8hpp_source.html">Bezier.hpp</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_primitive_8hpp_source.html">Primitive.hpp</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_keyboard_8hpp_source.html">Keyboard.hpp</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_material_8hpp_source.html">Material.hpp</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_grid_8hpp_source.html">Grid.hpp</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_electric_colour_8hpp_source.html">ElectricColour.hpp</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_camera_8hpp_source.html">Camera.hpp</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_world_8hpp_source.html">World.hpp</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_data_8hpp_source.html">Data.hpp</a>&quot;</code><br/>
<code>#include &lt;iostream&gt;</code><br/>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ab01c733d09125c1a0a1f6847009a1d4a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#ab01c733d09125c1a0a1f6847009a1d4a">MILLISECONDS_PER_FRAME</a>&#160;&#160;&#160;16</td></tr>
<tr class="memdesc:ab01c733d09125c1a0a1f6847009a1d4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of milliseconds for each frame; frames-per-second = 1000 / this.  <a href="#ab01c733d09125c1a0a1f6847009a1d4a"></a><br/></td></tr>
<tr class="separator:ab01c733d09125c1a0a1f6847009a1d4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5473cf64fa979b48335079c99532e243"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#a5473cf64fa979b48335079c99532e243">WINDOW_HEIGHT</a>&#160;&#160;&#160;400</td></tr>
<tr class="memdesc:a5473cf64fa979b48335079c99532e243"><td class="mdescLeft">&#160;</td><td class="mdescRight">The height of the game window.  <a href="#a5473cf64fa979b48335079c99532e243"></a><br/></td></tr>
<tr class="separator:a5473cf64fa979b48335079c99532e243"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a498d9f026138406895e9a34b504ac6a6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#a498d9f026138406895e9a34b504ac6a6">WINDOW_WIDTH</a>&#160;&#160;&#160;400</td></tr>
<tr class="memdesc:a498d9f026138406895e9a34b504ac6a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">The width of the game window.  <a href="#a498d9f026138406895e9a34b504ac6a6"></a><br/></td></tr>
<tr class="separator:a498d9f026138406895e9a34b504ac6a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a328a5ea7f87a9be8ffc2784f2243e272"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#a328a5ea7f87a9be8ffc2784f2243e272">MILLISECONDS_PER_FPS_UPDATE</a>&#160;&#160;&#160;300</td></tr>
<tr class="memdesc:a328a5ea7f87a9be8ffc2784f2243e272"><td class="mdescLeft">&#160;</td><td class="mdescRight">At every (this) milliseconds, the value of FPS stored in current_fps is updated.  <a href="#a328a5ea7f87a9be8ffc2784f2243e272"></a><br/></td></tr>
<tr class="separator:a328a5ea7f87a9be8ffc2784f2243e272"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a5d953fd9def7f59725d43854309b2c81"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#a5d953fd9def7f59725d43854309b2c81">main_key_down</a> (unsigned char key, int xx, int yy)</td></tr>
<tr class="memdesc:a5d953fd9def7f59725d43854309b2c81"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function gets called when a normal key on the keyboard gets pressed.  <a href="#a5d953fd9def7f59725d43854309b2c81"></a><br/></td></tr>
<tr class="separator:a5d953fd9def7f59725d43854309b2c81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a268c7c1058cfb6e35ec1675b3c5f7deb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#a268c7c1058cfb6e35ec1675b3c5f7deb">main_special_key_down</a> (int key, int xx, int yy)</td></tr>
<tr class="memdesc:a268c7c1058cfb6e35ec1675b3c5f7deb"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function gets called when a special key on the keyboard gets pressed.  <a href="#a268c7c1058cfb6e35ec1675b3c5f7deb"></a><br/></td></tr>
<tr class="separator:a268c7c1058cfb6e35ec1675b3c5f7deb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6742d889b0471174a21a3dc5994d25f3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#a6742d889b0471174a21a3dc5994d25f3">main_key_up</a> (unsigned char key, int xx, int yy)</td></tr>
<tr class="memdesc:a6742d889b0471174a21a3dc5994d25f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function gets called when a normal key on the keyboard gets released.  <a href="#a6742d889b0471174a21a3dc5994d25f3"></a><br/></td></tr>
<tr class="separator:a6742d889b0471174a21a3dc5994d25f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92d3d2be067e841ba1b6a16350f6377b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#a92d3d2be067e841ba1b6a16350f6377b">main_special_key_up</a> (int key, int xx, int yy)</td></tr>
<tr class="memdesc:a92d3d2be067e841ba1b6a16350f6377b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function gets called when a special key on the keyboard gets released.  <a href="#a92d3d2be067e841ba1b6a16350f6377b"></a><br/></td></tr>
<tr class="separator:a92d3d2be067e841ba1b6a16350f6377b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9a8b64de56c690951ef4346562aef40"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#ab9a8b64de56c690951ef4346562aef40">main_step_and_render</a> (int i)</td></tr>
<tr class="memdesc:ab9a8b64de56c690951ef4346562aef40"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function gets called at each frame.  <a href="#ab9a8b64de56c690951ef4346562aef40"></a><br/></td></tr>
<tr class="separator:ab9a8b64de56c690951ef4346562aef40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c04138a5bfe5d72780bb7e82a18e627"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a> (int argc, char **argv)</td></tr>
<tr class="memdesc:a3c04138a5bfe5d72780bb7e82a18e627"><td class="mdescLeft">&#160;</td><td class="mdescRight">The main function of the program.  <a href="#a3c04138a5bfe5d72780bb7e82a18e627"></a><br/></td></tr>
<tr class="separator:a3c04138a5bfe5d72780bb7e82a18e627"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a45d79734d7cf8999548480e72f610d40"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classcm_key_manager.html">cmKeyManager</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#a45d79734d7cf8999548480e72f610d40">kbm</a> = new <a class="el" href="classcm_key_manager.html">cmKeyManager</a>()</td></tr>
<tr class="memdesc:a45d79734d7cf8999548480e72f610d40"><td class="mdescLeft">&#160;</td><td class="mdescRight">This stores which keys are pressed and whatnot.  <a href="#a45d79734d7cf8999548480e72f610d40"></a><br/></td></tr>
<tr class="separator:a45d79734d7cf8999548480e72f610d40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afdc9aca4da969365814ec79ec4e56281"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_world.html">World</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#afdc9aca4da969365814ec79ec4e56281">gWorld</a></td></tr>
<tr class="memdesc:afdc9aca4da969365814ec79ec4e56281"><td class="mdescLeft">&#160;</td><td class="mdescRight">The physics world, which also handles rendering.  <a href="#afdc9aca4da969365814ec79ec4e56281"></a><br/></td></tr>
<tr class="separator:afdc9aca4da969365814ec79ec4e56281"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d4f553dce504b38a16b9164049195a6"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#a4d4f553dce504b38a16b9164049195a6">framecount</a></td></tr>
<tr class="memdesc:a4d4f553dce504b38a16b9164049195a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Used for timing the main loop. Todo: some better algorithm.  <a href="#a4d4f553dce504b38a16b9164049195a6"></a><br/></td></tr>
<tr class="separator:a4d4f553dce504b38a16b9164049195a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9c51867d2eb1cc4ffa3e074a9ccc14a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#ac9c51867d2eb1cc4ffa3e074a9ccc14a">lastupdatemill</a></td></tr>
<tr class="memdesc:ac9c51867d2eb1cc4ffa3e074a9ccc14a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Used for timing the main loop. Todo: some better algorithm.  <a href="#ac9c51867d2eb1cc4ffa3e074a9ccc14a"></a><br/></td></tr>
<tr class="separator:ac9c51867d2eb1cc4ffa3e074a9ccc14a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac89a670362c46d2b80d705782d862676"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#ac89a670362c46d2b80d705782d862676">lastframemill</a></td></tr>
<tr class="memdesc:ac89a670362c46d2b80d705782d862676"><td class="mdescLeft">&#160;</td><td class="mdescRight">Used for timing the main loop. Todo: some better algorithm.  <a href="#ac89a670362c46d2b80d705782d862676"></a><br/></td></tr>
<tr class="separator:ac89a670362c46d2b80d705782d862676"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae8d757346cd86633612877691e5aaca4"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#ae8d757346cd86633612877691e5aaca4">current_fps</a></td></tr>
<tr class="memdesc:ae8d757346cd86633612877691e5aaca4"><td class="mdescLeft">&#160;</td><td class="mdescRight">The value of frames-per-second that was last computed.  <a href="#ae8d757346cd86633612877691e5aaca4"></a><br/></td></tr>
<tr class="separator:ae8d757346cd86633612877691e5aaca4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6801cf474a7b2494c15057a5d43ca4a4"><td class="memItemLeft" align="right" valign="top">std::string *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#a6801cf474a7b2494c15057a5d43ca4a4">levelnames</a></td></tr>
<tr class="memdesc:a6801cf474a7b2494c15057a5d43ca4a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">The names of the levels in the game (match the names of files in the world/ directory).  <a href="#a6801cf474a7b2494c15057a5d43ca4a4"></a><br/></td></tr>
<tr class="separator:a6801cf474a7b2494c15057a5d43ca4a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aabd3fb9ce376aa38529cdee22199f4ed"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#aabd3fb9ce376aa38529cdee22199f4ed">curlevel</a></td></tr>
<tr class="memdesc:aabd3fb9ce376aa38529cdee22199f4ed"><td class="mdescLeft">&#160;</td><td class="mdescRight">The current level that you're playing.  <a href="#aabd3fb9ce376aa38529cdee22199f4ed"></a><br/></td></tr>
<tr class="separator:aabd3fb9ce376aa38529cdee22199f4ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac17f6a87984c497f6dd8c7fd13b8fca"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_main_8cpp.html#aac17f6a87984c497f6dd8c7fd13b8fca">numlevels</a></td></tr>
<tr class="memdesc:aac17f6a87984c497f6dd8c7fd13b8fca"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of levels in the game.  <a href="#aac17f6a87984c497f6dd8c7fd13b8fca"></a><br/></td></tr>
<tr class="separator:aac17f6a87984c497f6dd8c7fd13b8fca"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="a328a5ea7f87a9be8ffc2784f2243e272"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MILLISECONDS_PER_FPS_UPDATE&#160;&#160;&#160;300</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>At every (this) milliseconds, the value of FPS stored in current_fps is updated. </p>

</div>
</div>
<a class="anchor" id="ab01c733d09125c1a0a1f6847009a1d4a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MILLISECONDS_PER_FRAME&#160;&#160;&#160;16</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The number of milliseconds for each frame; frames-per-second = 1000 / this. </p>
<p>This is the main program. It has a loop that deals with the event queue, and updates and renders the game. Right now there are a lot of hardcoded things in here, which should be moved to different objects as the objects are developed, e.g. applying forces based on keyboard input. </p>

</div>
</div>
<a class="anchor" id="a5473cf64fa979b48335079c99532e243"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define WINDOW_HEIGHT&#160;&#160;&#160;400</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The height of the game window. </p>

</div>
</div>
<a class="anchor" id="a498d9f026138406895e9a34b504ac6a6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define WINDOW_WIDTH&#160;&#160;&#160;400</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The width of the game window. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a3c04138a5bfe5d72780bb7e82a18e627"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>argv</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The main function of the program. </p>
<p>This function opens up a window and starts running the game until you x out of it. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">argc</td><td>The number of arguments from the command line. </td></tr>
    <tr><td class="paramname">argv</td><td>The array of string argument from the command line, argv[0] = executablename. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if it runs and finishes well, something else otherwise. </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">An</td><td>error whenever something goes wrong. </td></tr>
  </table>
  </dd>
</dl>
<p>Todo: Test out calculus somewhere else.</p>
<p>Todo: test out fonts somewhere else. / Create a pixmap font from a TrueType file. </p>

</div>
</div>
<a class="anchor" id="a5d953fd9def7f59725d43854309b2c81"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void main_key_down </td>
          <td>(</td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>xx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>yy</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function gets called when a normal key on the keyboard gets pressed. </p>

</div>
</div>
<a class="anchor" id="a6742d889b0471174a21a3dc5994d25f3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void main_key_up </td>
          <td>(</td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>xx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>yy</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function gets called when a normal key on the keyboard gets released. </p>

</div>
</div>
<a class="anchor" id="a268c7c1058cfb6e35ec1675b3c5f7deb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void main_special_key_down </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>xx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>yy</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function gets called when a special key on the keyboard gets pressed. </p>

</div>
</div>
<a class="anchor" id="a92d3d2be067e841ba1b6a16350f6377b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void main_special_key_up </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>xx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>yy</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function gets called when a special key on the keyboard gets released. </p>

</div>
</div>
<a class="anchor" id="ab9a8b64de56c690951ef4346562aef40"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void main_step_and_render </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>i</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function gets called at each frame. </p>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="aabd3fb9ce376aa38529cdee22199f4ed"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int curlevel</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The current level that you're playing. </p>

</div>
</div>
<a class="anchor" id="ae8d757346cd86633612877691e5aaca4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double current_fps</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The value of frames-per-second that was last computed. </p>

</div>
</div>
<a class="anchor" id="a4d4f553dce504b38a16b9164049195a6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int framecount</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Used for timing the main loop. Todo: some better algorithm. </p>

</div>
</div>
<a class="anchor" id="afdc9aca4da969365814ec79ec4e56281"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_world.html">World</a>* gWorld</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The physics world, which also handles rendering. </p>

</div>
</div>
<a class="anchor" id="a45d79734d7cf8999548480e72f610d40"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classcm_key_manager.html">cmKeyManager</a>* kbm = new <a class="el" href="classcm_key_manager.html">cmKeyManager</a>()</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This stores which keys are pressed and whatnot. </p>

</div>
</div>
<a class="anchor" id="ac89a670362c46d2b80d705782d862676"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int lastframemill</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Used for timing the main loop. Todo: some better algorithm. </p>

</div>
</div>
<a class="anchor" id="ac9c51867d2eb1cc4ffa3e074a9ccc14a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int lastupdatemill</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Used for timing the main loop. Todo: some better algorithm. </p>

</div>
</div>
<a class="anchor" id="a6801cf474a7b2494c15057a5d43ca4a4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string* levelnames</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The names of the levels in the game (match the names of files in the world/ directory). </p>

</div>
</div>
<a class="anchor" id="aac17f6a87984c497f6dd8c7fd13b8fca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int numlevels</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The number of levels in the game. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="_main_8cpp.html">Main.cpp</a></li>
    <li class="footer">Generated on Sun Oct 28 2012 13:14:15 for Optimist Racing by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.2 </li>
  </ul>
</div>
</body>
</html>
